<#--Template xmlns="SQLDataModel" Name="SQLTable" RootType="Table"-->
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [${Owner}].[${Name}] (
<#list Columns as column>
       [${column.Name}] [${column.Type.Name}]<#if column.Type.Precision?? &&
column.Type.Scale??>(${column.Type.Precision},${column.Type.Scale})<#else>(${column.Type.Length})</#if>
<#if column.Identity??>IDENTITY(${column.Identity.Seed},${column.Identity.Increment})</#if>
<#if !column.AllowNulls>NOT</#if> NULL<#if column.DefaultValue??>
CONSTRAINT [DF_${Name}_${column.Name}] DEFAULT
(${column.DefaultValue})</#if><#if columns?last != column>,</#if>
</#list>
<#if PrimaryKey??>
       CONSTRAINT [PK_${Name}] PRIMARY KEY CLUSTERED (
       <#list PrimaryKey.Columns as column>
               [${column.Name}] ${column.Direction!"ASC"}<#if
PrimaryKey.Columns?last != column>,</#if>
       </#list>
       ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY
= OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON
[${FileGroup!"PRIMARY"}]
</#if>
) ON [${FileGroup!"PRIMARY"}

GO
SET ANSI_PADDING OFF